<template>
  <el-cascader
    v-model="value"
    :options="cascadeData"
    :props="{ emitPath: true,checkStrictly: true}"
    :show-all-levels="true"
    style="width: 100%"
    clearable
    @change="changeValue"
  />
</template>
<script>
export default {
  data() {
    return {
      value: [],
      cascadeData: [],
      callbackMethod: ''
    }
  },
  methods: {
    changeValue(e) {
      this.$emit(this.callbackMethod, this.value)
    },
    setSelectValue(value) {
      this.value = value
    },
    initData(cascadeData, callbackMethod) {
      this.cascadeData = cascadeData
      this.callbackMethod = callbackMethod
    }
  }
}
</script>
